package com.baizhi.syh.controller;


import com.baizhi.syh.VO.PageVO;
import com.baizhi.syh.VO.UserResultVO;
import com.baizhi.syh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("user")//设定访问名
@ResponseBody//响应时转换为Jason格式
@CrossOrigin //解决跨区域问题
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping("queryAllPage")
    public UserResultVO OneShowAll(@RequestBody PageVO pageVO){
        if (pageVO.getPage() == null) {
            pageVO.setPage(1);
        }
        return userService.selectUserPage(pageVO);
    }
}
